<template>
  <div class="execution">
    <basic-container>
      <el-tabs type="border-card" v-model="activeName" @tab-click="handlerTabsChange" style="margin-top: 20px">
        <el-tab-pane label="全部" name="first">
          <draw-list ref="allDrawList"></draw-list>
        </el-tab-pane>
        <el-tab-pane label="待审核" name="second">
          <draw-list  ref="noAuditDrawList"></draw-list>
        </el-tab-pane>
        <el-tab-pane label="待打款" name="third">
          <draw-list ref="noPayDrawList"></draw-list>
        </el-tab-pane>
        <el-tab-pane label="已打款" name="four">
          <draw-list ref="payDrawList"></draw-list>
        </el-tab-pane>
        <el-tab-pane label="已驳回" name="five">
          <draw-list ref="invalidDrawList"></draw-list>
        </el-tab-pane>
      </el-tabs>

    </basic-container>

  </div>
</template>

<script>
  import drawList from './drawlist'

  export default {
    components: {
      drawList
    },
    name: 'deliverymandraw',
    data() {
      return {
        activeName: 'first',
        tableData: [],
        tableLoading: false,
        searchFrom: {
          drawStatus: this.currentDrawStatus,
          deName: '',
          dePhone: ''
        },
        form: {},
        option: {
          option: [{
            column: [{
              label: '姓名',
              prop: 'deName'
            }, {
              label: '提现金额',
              prop: 'drawMoney'
            }]
          }]
        }
      }
    },
    created() {
    },
    mounted: function () {
      // this.getList(this.page, this.searchFrom)
      this.$refs.allDrawList.init()
    },
    // computed: {
    //   ...mapGetters(['permissions'])
    // },
    methods: {
      handlerTabsChange(tab, event) {
        switch (Number(tab.index)) {
          case 0:
            this.currentDrawStatus = ''
            this.$refs.allDrawList.init()
            break;
          case 1:
            this.currentDrawStatus = 0
            this.$refs.noAuditDrawList.init({'drawStatus': this.currentDrawStatus})
            break
          case 2:
            this.currentDrawStatus = 1
            this.$refs.noPayDrawList.init({'drawStatus': this.currentDrawStatus})
            break
          case 3:
            this.currentDrawStatus = 3
            this.$refs.payDrawList.init({'drawStatus': this.currentDrawStatus})
            break
          case 4:
            this.currentDrawStatus = 2
            this.$refs.invalidDrawList.init({'drawStatus': this.currentDrawStatus})
            break
        }
      }
    }
  }
</script>

<style lang="scss" scoped>
  .el-dialog__body {
    padding: 0 20px !important;
  }
</style>
